package org.stephen.recommend.common;

import org.stephen.recommend.enums.LanguageType;

/**
 * ClassName: RedisKeyPrefix
 * Description:推荐算法 redis存储 key 前缀
 * Date: 2020/12/16 11:34
 *
 * @author stephen.qiu
 */
public class RedisKeyPrefix {
    /**
     * 准备推荐的文章id
     */
    public final static String RECOMMEND_ARTICLE_IDS = "recommendArticleIds:";
    /**
     * 用户看过的文章id
     */
    public final static String VIEW_ARTICLE_IDS = "viewedArticleIds:";
    /**
     * 中文标签
     */
    private final static String ZH_TAG = "zhTag:";
    /**
     * 英文标签
     */
    private final static String EN_TAG = "enTag:";
    /**
     * 用户中文标签
     */
    private final static String USER_ZH_TAGS = "userZhTags:";

    /**
     * 用户英文标签
     */
    private final static String USER_EN_TAGS = "userEnTags:";

    /**
     * 推荐过的文章id
     */
    public final static String RECOMMENDED_ARTICLE_IDS = "recommendedArticleIds:";
    /**
     * 相似用户
     */
    public final static String SIMILARITY_USERS = "similarityUsers:";

    public static String getTag(LanguageType languageType) {
        return languageType.equals(LanguageType.EN_US) ? EN_TAG : ZH_TAG;
    }

    public static String getTag() {
        return ZH_TAG;
    }

    public static String getUserTag(LanguageType languageType) {
        return languageType.equals(LanguageType.EN_US) ? USER_EN_TAGS : USER_ZH_TAGS;
    }

    public static String getUserTag() {
        return USER_ZH_TAGS;
    }
}
